<?php
class Article extends AppModel {

	var $name = 'Article';
	var $validate = array(
		'title' => VALID_NOT_EMPTY,
		'text' => VALID_NOT_EMPTY,
		'intro_text' => VALID_NOT_EMPTY
	);
	
	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
			'User' => array('className' => 'User',
								'foreignKey' => 'user_id',
								'conditions' => '',
								'fields' => 'name,username,email',
								'order' => '',
								'counterCache' => ''),
			'Category' => array('className' => 'Category',
								'foreignKey' => 'category_id',
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'counterCache' => ''),
	);

	var $hasMany = array(
			'Comment' => array('className' => 'Comment',
								'foreignKey' => 'article_id',
								'conditions' => '(Comment.antispam ="" or Comment.antispam is null)',
								'fields' => '',
								'order' => 'Comment.created',
								'limit' => '',
								'offset' => '',
								'dependent' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''),
			'Rating' => array('className' => 'Rating',
								'foreignKey' => 'article_id',
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'dependent' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''),								
	);

	var $hasAndBelongsToMany = array(
			'Tag' => array('className' => 'Tag',
						'joinTable' => 'articles_tags',
						'foreignKey' => 'article_id',
						'associationForeignKey' => 'tag_id',
						'conditions' => '',
						'fields' => '',
						'order' => '',
						'limit' => '',
						'offset' => '',
						'unique' => '',
						'finderQuery' => '',
						'deleteQuery' => '',
						'insertQuery' => ''),
	);
}
?>